<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="btn">save</div>
    <!-- <img src="./signIn.jpg" width="500" height="300" /> -->
    <div class="canvas-dom"></div>
    <script src="index.js"></script>
    <script>
      const tool = new CanvasPenTool({
        dom: ".canvas-dom",
        imgUrl: "cc.jpg",
        onSave: (res) => {
          console.log(res);
          document.body.appendChild(res)
        },
      });
      document.getElementById("btn").onclick = (e) => {
        tool.save((res) => {
          document.body.appendChild(res)
          console.log(res.toDataURL("image/webp"));
        });
      };
    </script>
  </body>
  <style>
    .canvas-dom {
      width: 1280px;
      height: 720px;
      position: fixed;
      left: 300px;
    }
    .ad {
      position: absolute;
      cursor: pointer;
      transform: translate();
    }
  </style>
</html>
